home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / WINDOWS / EZNET.ZIP / EDITOR.ZIP / ITEMPROP.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-07-21  |  13.4 KB  |  430 lines

  1. VERSION 4.00
  2. Begin VB.Form ItemProp 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Properties"
  5.    ClientHeight    =   4965
  6.    ClientLeft      =   1500
  7.    ClientTop       =   1215
  8.    ClientWidth     =   6225
  9.    Height          =   5370
  10.    Left            =   1440
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4965
  15.    ScaleWidth      =   6225
  16.    ShowInTaskbar   =   0   'False
  17.    Top             =   870
  18.    Width           =   6345
  19.    Begin VB.Frame FrameUserData 
  20.       Caption         =   "User Data"
  21.       Height          =   2145
  22.       Left            =   2430
  23.       TabIndex        =   16
  24.       Top             =   2670
  25.       Width           =   3615
  26.       Begin VB.TextBox Text1 
  27.          Height          =   555
  28.          Left            =   1020
  29.          MultiLine       =   -1  'True
  30.          ScrollBars      =   2  'Vertical
  31.          TabIndex        =   27
  32.          Top             =   300
  33.          Width           =   2415
  34.       End
  35.       Begin VB.TextBox Text4 
  36.          Height          =   315
  37.          Left            =   1020
  38.          TabIndex        =   22
  39.          Top             =   1680
  40.          Width           =   825
  41.       End
  42.       Begin VB.TextBox Text3 
  43.          Height          =   315
  44.          Left            =   1020
  45.          TabIndex        =   21
  46.          Top             =   1290
  47.          Width           =   825
  48.       End
  49.       Begin VB.TextBox Text2 
  50.          Height          =   285
  51.          Left            =   1020
  52.          TabIndex        =   17
  53.          Top             =   930
  54.          Width           =   2415
  55.       End
  56.       Begin VB.Label Label1 
  57.          Alignment       =   1  'Right Justify
  58.          Caption         =   "Text:"
  59.          Height          =   255
  60.          Left            =   240
  61.          TabIndex        =   28
  62.          Top             =   300
  63.          Width           =   555
  64.       End
  65.       Begin VB.Label Label8 
  66.          Alignment       =   1  'Right Justify
  67.          Caption         =   "Long Data:"
  68.          Height          =   255
  69.          Left            =   120
  70.          TabIndex        =   20
  71.          Top             =   1710
  72.          Width           =   825
  73.       End
  74.       Begin VB.Label Label7 
  75.          Alignment       =   1  'Right Justify
  76.          Caption         =   "Short Data:"
  77.          Height          =   255
  78.          Left            =   120
  79.          TabIndex        =   19
  80.          Top             =   1350
  81.          Width           =   825
  82.       End
  83.       Begin VB.Label Label6 
  84.          Alignment       =   1  'Right Justify
  85.          Caption         =   "Item Tag:"
  86.          Height          =   255
  87.          Left            =   90
  88.          TabIndex        =   18
  89.          Top             =   960
  90.          Width           =   855
  91.       End
  92.    End
  93.    Begin VB.CommandButton CommandForeColor 
  94.       Caption         =   "Fore Color..."
  95.       Height          =   375
  96.       Left            =   180
  97.       TabIndex        =   15
  98.       Top             =   4440
  99.       Width           =   1305
  100.    End
  101.    Begin VB.CommandButton CommandDrawColor 
  102.       Caption         =   "Draw Color..."
  103.       Height          =   375
  104.       Left            =   180
  105.       TabIndex        =   14
  106.       Top             =   4020
  107.       Width           =   1305
  108.    End
  109.    Begin VB.CommandButton CommandFillColor 
  110.       Caption         =   "Fill Color..."
  111.       Height          =   375
  112.       Left            =   180
  113.       TabIndex        =   13
  114.       Top             =   3600
  115.       Width           =   1305
  116.    End
  117.    Begin VB.ComboBox ComboDrawStyle 
  118.       Height          =   315
  119.       ItemData        =   "ITEMPROP.frx":0000
  120.       Left            =   1590
  121.       List            =   "ITEMPROP.frx":0019
  122.       Style           =   2  'Dropdown List
  123.       TabIndex        =   11
  124.       Top             =   2220
  125.       Width           =   2415
  126.    End
  127.    Begin VB.CheckBox CheckHiding 
  128.       Alignment       =   1  'Right Justify
  129.       Caption         =   "Hiding Item"
  130.       Height          =   255
  131.       Left            =   180
  132.       TabIndex        =   10
  133.       Top             =   3210
  134.       Width           =   1635
  135.    End
  136.    Begin VB.CheckBox CheckTransparent 
  137.       Alignment       =   1  'Right Justify
  138.       Caption         =   "Node Transparent"
  139.       Height          =   255
  140.       Left            =   180
  141.       TabIndex        =   9
  142.       Top             =   2910
  143.       Width           =   1635
  144.    End
  145.    Begin VB.ComboBox ComboLinkHead 
  146.       Height          =   315
  147.       ItemData        =   "ITEMPROP.frx":007F
  148.       Left            =   1590
  149.       List            =   "ITEMPROP.frx":009B
  150.       Style           =   2  'Dropdown List
  151.       TabIndex        =   8
  152.       Top             =   1860
  153.       Width           =   2415
  154.    End
  155.    Begin VB.CheckBox CheckOriented 
  156.       Alignment       =   1  'Right Justify
  157.       Caption         =   "Link Oriented"
  158.       Height          =   255
  159.       Left            =   180
  160.       TabIndex        =   7
  161.       Top             =   2610
  162.       Width           =   1635
  163.    End
  164.    Begin VB.ComboBox ComboAlignment 
  165.       Height          =   315
  166.       ItemData        =   "ITEMPROP.frx":013F
  167.       Left            =   1590
  168.       List            =   "ITEMPROP.frx":015E
  169.       Style           =   2  'Dropdown List
  170.       TabIndex        =   4
  171.       Top             =   1500
  172.       Width           =   2415
  173.    End
  174.    Begin VB.CommandButton Command2 
  175.       Cancel          =   -1  'True
  176.       Caption         =   "Cancel"
  177.       Height          =   435
  178.       Left            =   5130
  179.       TabIndex        =   3
  180.       Top             =   630
  181.       Width           =   915
  182.    End
  183.    Begin VB.CommandButton Command1 
  184.       Caption         =   "Ok"
  185.       Default         =   -1  'True
  186.       Height          =   435
  187.       Left            =   5130
  188.       TabIndex        =   2
  189.       Top             =   150
  190.       Width           =   915
  191.    End
  192.    Begin VB.ComboBox ComboShape 
  193.       Height          =   315
  194.       ItemData        =   "ITEMPROP.frx":023D
  195.       Left            =   1590
  196.       List            =   "ITEMPROP.frx":025C
  197.       Style           =   2  'Dropdown List
  198.       TabIndex        =   0
  199.       Top             =   1140
  200.       Width           =   2415
  201.    End
  202.    Begin VB.Label LabelComment 
  203.       BorderStyle     =   1  'Fixed Single
  204.       BeginProperty Font 
  205.          name            =   "MS Sans Serif"
  206.          charset         =   0
  207.          weight          =   700
  208.          size            =   8.25
  209.          underline       =   0   'False
  210.          italic          =   0   'False
  211.          strikethrough   =   0   'False
  212.       EndProperty
  213.       Height          =   795
  214.       Left            =   180
  215.       TabIndex        =   26
  216.       Top             =   180
  217.       Width           =   3855
  218.    End
  219.    Begin VB.Label LabelForeColor 
  220.       BorderStyle     =   1  'Fixed Single
  221.       Height          =   345
  222.       Left            =   1590
  223.       TabIndex        =   25
  224.       Top             =   4440
  225.       Width           =   345
  226.    End
  227.    Begin VB.Label LabelDrawColor 
  228.       BorderStyle     =   1  'Fixed Single
  229.       Height          =   345
  230.       Left            =   1590
  231.       TabIndex        =   24
  232.       Top             =   4020
  233.       Width           =   345
  234.    End
  235.    Begin VB.Label LabelFillColor 
  236.       BorderStyle     =   1  'Fixed Single
  237.       Height          =   345
  238.       Left            =   1590
  239.       TabIndex        =   23
  240.       Top             =   3600
  241.       Width           =   345
  242.    End
  243.    Begin MSComDlg.CommonDialog CommonDialog1 
  244.       Left            =   4440
  245.       Top             =   390
  246.       _Version        =   65536
  247.       _ExtentX        =   847
  248.       _ExtentY        =   847
  249.       _StockProps     =   0
  250.    End
  251.    Begin VB.Label Label5 
  252.       Caption         =   "DrawStyle:"
  253.       Height          =   255
  254.       Left            =   180
  255.       TabIndex        =   12
  256.       Top             =   2220
  257.       Width           =   1320
  258.    End
  259.    Begin VB.Label Label4 
  260.       Caption         =   "Link Arrow Head:"
  261.       Height          =   255
  262.       Left            =   180
  263.       TabIndex        =   6
  264.       Top             =   1860
  265.       Width           =   1320
  266.    End
  267.    Begin VB.Label Label3 
  268.       Caption         =   "Text Alignment:"
  269.       Height          =   255
  270.       Left            =   180
  271.       TabIndex        =   5
  272.       Top             =   1500
  273.       Width           =   1320
  274.    End
  275.    Begin VB.Label Label2 
  276.       Caption         =   "Node Shape:"
  277.       Height          =   255
  278.       Left            =   180
  279.       TabIndex        =   1
  280.       Top             =   1140
  281.       Width           =   1320
  282.    End
  283. Attribute VB_Name = "ItemProp"
  284. Attribute VB_Creatable = False
  285. Attribute VB_Exposed = False
  286. Option Explicit
  287. Sub SetItemProperties(Net1 As Control, item As Long)
  288.   With Net1
  289.     .SetItemDrawColor item, LabelDrawColor.BackColor
  290.     .SetItemForeColor item, LabelForeColor.BackColor
  291.     .SetItemText item, Text1
  292.     .SetItemTag item, Text2
  293.     .SetItemShort item, Val(Text3)
  294.     .SetItemLong item, Val(Text4)
  295.     .SetItemDrawStyle item, ComboDrawStyle.ListIndex
  296.     .SetItemHiding item, (CheckHiding.value = 1)
  297.     If .IsItemLink(item) Then
  298.       .SetLinkOriented item, (CheckOriented.value = 1)
  299.       .SetLinkArrowHead item, ComboLinkHead.ListIndex
  300.     Else
  301.       .SetNodeTransparent item, (CheckTransparent.value = 1)
  302.       .SetNodeShape item, ComboShape.ListIndex
  303.       .SetNodeAlignment item, ComboAlignment.ListIndex
  304.       .SetNodeFillColor item, LabelFillColor.BackColor
  305.     End If
  306.   End With
  307. End Sub
  308. Private Sub Command1_Click()
  309.   With Main.Net1
  310.     If .item <> 0 Then
  311.       ' There is a current item
  312.       SetItemProperties Main.Net1, .item
  313.     Else
  314.       ' No current item
  315.       .FillColor = LabelFillColor.BackColor
  316.       .ForeColor = LabelForeColor.BackColor
  317.       .DrawColor = LabelDrawColor.BackColor
  318.       .DrawStyle = ComboDrawStyle.ListIndex
  319.       .Oriented = (CheckOriented.value = 1)
  320.       .LinkHead = ComboLinkHead.ListIndex
  321.       .Hiding = (CheckHiding.value = 1)
  322.       .Transparent = (CheckTransparent.value = 1)
  323.       .Shape = ComboShape.ListIndex
  324.       .Alignment = ComboAlignment.ListIndex
  325.     End If
  326.   End With
  327.   Unload Me
  328. End Sub
  329. Private Sub Command2_Click()
  330.   Unload Me
  331. End Sub
  332. Private Sub CommandDrawColor_Click()
  333.   With CommonDialog1
  334.     .Color = LabelDrawColor.BackColor
  335.     .Flags = cdlCCRGBInit
  336.     .Action = 3
  337.     LabelDrawColor.BackColor = .Color
  338.   End With
  339. End Sub
  340. Private Sub CommandFillColor_Click()
  341.   With CommonDialog1
  342.     .Color = LabelFillColor.BackColor
  343.     .Flags = cdlCCRGBInit
  344.     .Action = 3
  345.     LabelFillColor.BackColor = .Color
  346.   End With
  347. End Sub
  348. Private Sub CommandForeColor_Click()
  349.   With CommonDialog1
  350.     .Color = LabelForeColor.BackColor
  351.     .Flags = cdlCCRGBInit
  352.     .Action = 3
  353.     LabelForeColor.BackColor = .Color
  354.   End With
  355. End Sub
  356. Private Sub Form_Load()
  357.   With Main.Net1
  358.     If .item = 0 Then
  359.       FrameUserData.Visible = False
  360.       LabelComment.Caption = "No current item: therefore property settings are persistent. Next created items will received those property values by default."
  361.       Text1.Enabled = False
  362.       Text2.Enabled = False
  363.       Text3.Enabled = False
  364.       Text4.Enabled = False
  365.       If .Oriented Then
  366.         CheckOriented.value = 1
  367.       Else
  368.         CheckOriented.value = 0
  369.       End If
  370.       ComboLinkHead.ListIndex = .LinkHead
  371.       If .Transparent Then
  372.         CheckTransparent.value = 1
  373.       Else
  374.         CheckTransparent.value = 0
  375.       End If
  376.       ComboShape.ListIndex = .Shape
  377.       ComboAlignment.ListIndex = .Alignment
  378.       LabelFillColor.BackColor = .FillColor
  379.       If .Hiding Then
  380.         CheckHiding.value = 1
  381.       Else
  382.         CheckHiding.value = 0
  383.       End If
  384.       ComboDrawStyle.ListIndex = .DrawStyle
  385.       LabelDrawColor.BackColor = .DrawColor
  386.       LabelForeColor.BackColor = .ForeColor
  387.     Else
  388.       If .IsLink Then
  389.         LabelComment.Caption = "The current item is a link. ""Node-only"" properties are disabled. Property settings will apply only to this current link."
  390.         If .Oriented Then
  391.           CheckOriented.value = 1
  392.         Else
  393.           CheckOriented.value = 0
  394.         End If
  395.         ComboShape.Enabled = False
  396.         ComboAlignment.Enabled = False
  397.         ComboLinkHead.ListIndex = .LinkHead
  398.         CommandFillColor.Enabled = False
  399.         CheckTransparent.Enabled = False
  400.       Else
  401.         LabelComment.Caption = "The current item is a node. ""Link-only"" properties are disabled. Property settings will apply only to this current node."
  402.         If .Transparent Then
  403.           CheckTransparent.value = 1
  404.         Else
  405.           CheckTransparent.value = 0
  406.         End If
  407.         CheckOriented.Enabled = False
  408.         ComboLinkHead.Enabled = False
  409.         ComboShape.ListIndex = .Shape
  410.         ComboAlignment.ListIndex = .Alignment
  411.         LabelFillColor.BackColor = .FillColor
  412.       End If
  413.       If .Hiding Then
  414.         CheckHiding.value = 1
  415.       Else
  416.         CheckHiding.value = 0
  417.       End If
  418.       ComboDrawStyle.ListIndex = .DrawStyle
  419.       LabelDrawColor.BackColor = .DrawColor
  420.       LabelForeColor.BackColor = .ForeColor
  421.       Text1 = .Text
  422.       Text2 = .ItemTag
  423.       Text3 = Str(.Type)
  424.       Text4 = Str(.Data)
  425.     End If
  426.   End With
  427. End Sub
  428. Private Sub OptionApply_Click(Index As Integer)
  429. End Sub
  430.